<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>个人中心</title>
    <link rel="stylesheet" href="mobile/layui/css/layui.mobile.css">
    <link rel="stylesheet" href="mobile/layui/css/layui.css">
    <link rel="stylesheet" href="mobile/css/yj_css.css">

</head>
<body>
<header class="yj-header">
    <a class="yj-header-return layui-icon"></a>
    <span>个人中心</span>
    <a class="yj-header-meau"></a>
</header>
<footer class="yj-footer">
    <a class="yj-footer-item" href="lessorindex">
        <span class="yj-footer-icon"><img src="mobile/images/home1.png"></span>
        <p class="yj-footer-title">首页</p>
    </a>
    <a class="yj-footer-item yj-footer-middle">
        <span class="yj-footer-icon"><img src="mobile/images/user2.png"></span>
        <p class="yj-footer-title yj-color-main">会员中心</p>
    </a>
    <a class="yj-footer-item" href="lessororder">
        <span class="yj-footer-icon"><img src="mobile/images/printer1.png"></span>
        <p class="yj-footer-title">订单详情</p>
    </a>
</footer>

<div class="yj-content">
    <div class="yj-user-header">
        <a class="yj-user-set" href="set.html"><i class="layui-icon">&#xe614;</i></a>
        <img class="yj-user-photo" src="mobile/images/head.jpeg" onclick="login_popup()">
        <p class="yj-user-name" onclick="authentication()" th:unless="${session.currentUser.userInfo.uName}"
           th:text="请上传认证信息"></p>
        <p class="yj-user-name" th:if="${session.currentUser.userInfo.uName}"
           th:text="${session.currentUser.userInfo.uName}"></p>
    </div>

    <div class="yj-mar-t yj-bgfff">
        <ul class="yj-list yj-pad-lr-big">
            <li class="yj-list-item" id="invesetMoney">
                <img class="yj-list-item-icon" src="mobile/images/tb4.png">账户金额
                <span class="yj-right yj-color-gray-light">
              <font class="yj-color-red"><span id="uMoney"></span>￥</font>
              <i class="layui-icon yj-mar-l">&#xe602;</i>
            </span>
            </li>
            <li class="yj-list-item">
                <a class="yj-block" href="javascript:void(0)" onclick="share()">
                    <img class="yj-list-item-icon" src="mobile/images/tb7.png">分享给好友
                    <span class="yj-right yj-color-gray-light">
            分享领红包
              <i class="layui-icon yj-right yj-color-gray-light">&#xe602;</i></span>
                </a>
            </li>
        </ul>
    </div>
</div>

<script th:src="@{/mobile/js/jquery.min.js}"></script>
<script th:src="@{/mobile/layui/layui.js}"></script>
<script th:src="@{/mobile/layer/mobile/layer.js}"></script>
<script th:inline="javascript">
    var url = [[@{
        /}]];
        var shareUrl = "";

        function authentication() {
            window.location.href = "user/authentication";
        }

        $.ajax({
            url: url + "userInfo/share",
            success: function (result) {
                shareUrl = result.result.link;
            }
        });
</script>
<script type="text/javascript">

    $(function () {
        $.ajax({
            url: url + "userInfo/activeUserInfo",
            type: "get",
            success: function (result) {
                $("#uMoney").html(result.uMoney);
            }
        })
    })


    function share() {

        layer.open({
            type: 1,
            title: [
                '分享到',
                'background-color: #393D49; color:#fff;'
            ]
            , content: '<div >\n' +
                '            <a href="http://connect.qq.com/widget/shareqq/index.html?url=' + shareUrl + '">\n' +
                '                <img src="mobile/images/qq.png" alt=""/>\n' +
                '            </a>\n' +
                '            <a href="http://zixuephp.net/inc/qrcode_img.php?url=' + shareUrl + '">\n' +
                '                <img src="mobile/images/wx.png" alt=""/>\n' +
                '            </a>\n' +
                '            <a href="http://service.weibo.com/share/share.php?url=' + shareUrl + '">\n' +
                '                <img src="mobile/images/wb.png" alt=""/>\n' +
                '            </a>\n' +
                '        </div>'
            , skin: 'footer'
        });
    }
</script>

</body>
</html>